package yzserver.sx4a.dao.ibatis;

import com.sitech.ibnms.core.BaseIbnmsDao;
import yzserver.sx4a.dao.IDistrictDao;
import yzserver.sx4a.domain.DistrictDomain;

import java.util.HashMap;
import java.util.List;

public class DictrictDaoImpl extends BaseIbnmsDao implements IDistrictDao {


    @Override
    public DistrictDomain selDistrict(String districtid) {
        HashMap map = new HashMap();
        map.put("districtid",districtid);
        return (DistrictDomain)querySingle("shanxi_selDistrict",map);
    }

    @Override
    public void addDistrict(DistrictDomain district) throws Exception {
        insert("shanxi_addDistrict",district);
    }

    @Override
    public void updDistrict(DistrictDomain district) throws Exception {
        update("shanxi_updDistrict",district);
    }

    @Override
    public void delDistrict(String districtid) throws Exception {
        HashMap map = new HashMap();
        map.put("districtid",districtid);
        delete("shanxi_delDistrict",map);
    }

    @Override
    public List<DistrictDomain> selAllDistrict(String districtid) {
        HashMap map = new HashMap();
        map.put("districtid",districtid);
        return (List<DistrictDomain>)query("shanxi_selAllDistrict", map);
    }
}
